package com.charzhan.eight;

import com.charzhan.utiles.rabbitmqutil;
import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;

import java.nio.charset.StandardCharsets;

public class produce {
    public static final String NORMAL_EXCHANGE="normal_exchange";
    public static void main(String[] args)  throws  Exception{
        Channel channel = rabbitmqutil.getChannel();
        AMQP.BasicProperties basicProperties = new AMQP.BasicProperties()
                .builder().expiration("10000").build();



        for (int i = 0; i < 11; i++) {
            String message= "info"+i;
            channel.basicPublish(NORMAL_EXCHANGE,"zhangsan",basicProperties,message.getBytes(StandardCharsets.UTF_8));
        }
    }
}
